package com.open.capacity.task.dao;

import com.open.capacity.common.model.SysTask;
import com.open.capacity.common.web.Result;
import com.open.capacity.task.model.TaskComment;
import com.open.capacity.task.model.TaskPublishLog;
import com.open.capacity.task.model.TaskReply;
import com.open.capacity.task.model.TreeNode;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface TaskDao {
    Integer findTaskCounts();   //查询任务总量

    Integer publishTask(SysTask task);

    Integer updateTask(SysTask sysTask);

    void logPublish(TaskPublishLog log);

    Integer addTaskType(Map<String, String> taskType);

    Map findTaskType(String type);

    Integer addTaskLevel(Map<String, Object> type);

    Map findTaskLevel(String type);

    Integer updateTaskLevel(Map<String, Object> type);

    Integer updateTaskType(Map<String, String> taskType);

    List<SysTask> findTasks(Map<String, Object> conditions);

    int count(Map<String, Object> conditions);

    List<TreeNode> findTaskAreaTreeNode(Map<String, Object> params);

    List<String> findRolesTaskAreasTaskCodeId(String tkcode);

    int delTaskAreaRelation(String tkcode);

    int addTaskAreaRelation(@Param("tkcode") String tkcode, @Param("stringList") List<String> stringList);

    List<SysTask> findTaskCodeByTaskId(Integer taskId);

    int delByTaskId(int taskId);

    int recByTaskId(int taskId);

    List<SysTask> findMyPublishTasks(Map<String, Object> params);

    int findMyPublishTasksCount(Map<String, Object> params);

    List<TaskReply> findMyPublishTaskAdopt(Map<String, Object> params);

    int findMyPublishTaskAdoptCount(Map<String, Object> params);

    List<SysTask> findTaskByTaskId(int taskid);

    int adoptReply(int replid);

    int endTaskByTaskid(int taskid);

    List<TaskComment> findTaskComment(Map<String, Object> params);

    int findTaskCommentCount(Map<String, Object> params);


    int existGet(Map<String, Object> params);

    int getTaskByTaskid(Map<String, Object> params);

    List<SysTask> findAll();

    List<TaskComment> findMyInterceptTasks(Map<String, Object> params);

    int findMyInterceptTasksCount(Map<String, Object> params);

    int onlineReply(Map<String, Object> params);
    
    int updateOnlineReply(Map<String, Object> params);

    Integer haveOnlineReply(Map<String, Object> params);

    SysTask findTaskReply(SysTask sysTask);

//    SysTask findTaskReply(SysTask sysTask);
}
